package com.dbz.dao;

import com.baomidou.mybatisplus.core.conditions.Wrapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.core.toolkit.Constants;
import com.dbz.entity.Supplier;
import org.apache.ibatis.annotations.Param;

import javax.validation.constraints.Max;
import java.util.List;
import java.util.Set;

public interface SupplierDao extends BaseMapper<Supplier> {
    /**
     *查询树
     * @return
     */
    public Set<Supplier>queryDeptTreeList();

    /**
     * 根据供应商id查询供应商下的祸
     */

    public Set<Supplier>selectDeptChildrenById(String supplierid);

    /**
     * 查询供应商
     * @return
     */
    public Set<Supplier>queryDeptTreeLists();

    /**
     * 根据id查询供应商名称
     * @param sid
     * @return
     */
    public String selectNameById(String sid);





    /**
     * 分页查询
     * @param page
     * @param queryMapper
     * @return
     */
    public IPage<Supplier> selectPage(IPage<Supplier> page, @Param(Constants.WRAPPER) Wrapper<Supplier> queryMapper);

    /**
     * 根据id删除供应商
     * @param supplierid
     * @return
     */
    public int delecteSupplier(String supplierid);

    /**
     * 添加供应商信息
     * @param sname
     * @param sphone
     * @return
     */
    public int insertSupplier(String sname,String saccount,String sphone);

    /**
     * 修改供应商信息
     * @param supplierid
     * @param sname
     * @param saccount
     * @return
     */
    public int updateSupplier(String supplierid,String sname,String saccount,String sphone);


}
